//
//  WRYBottomView.m
//  BaiSiBuJie
//
//  Created by wry on 16/5/6.
//  Copyright © 2016年 WRY. All rights reserved.
//

#import "WRYBottomView.h"

@interface WRYBottomView ()
@property (weak, nonatomic) IBOutlet UIButton * dingBtn;
@property (weak, nonatomic) IBOutlet UIButton * caiBtn;
@property (weak, nonatomic) IBOutlet UIButton * shareBtn;
@property (weak, nonatomic) IBOutlet UIButton * commentBtn;

@end


@implementation WRYBottomView

-(void)setItem:(WRYThemeItem *)item
{
    [super setItem:item];
    [self setBtnTiltle:_dingBtn Count:item.ding];
    [self setBtnTiltle:_caiBtn Count:item.cai];
    [self setBtnTiltle:_commentBtn Count:item.comment];
    [self setBtnTiltle:_shareBtn Count:item.repost];
}
-(void)setBtnTiltle:(UIButton *)btn Count:(NSInteger)count
{
    NSString *str=[NSString stringWithFormat:@"%zd",count];
    if (count>10000) {
        CGFloat num=1.0*count/10000;
        str=[NSString stringWithFormat:@"%.1f万",num];
        str=[str stringByReplacingOccurrencesOfString:@".0" withString:@""];
    }
    
    [btn setTitle:str forState:(UIControlStateNormal)];
}


@end
